package com.zfx.beandefinition;

import com.zfx.aop.CgLibUtils;
import com.zfx.service.MyAopService;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;

public class CustomerAopBeanPostProcessor implements BeanPostProcessor {

	@Override
	public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
		if (bean instanceof MyAopService){
			bean = CgLibUtils.cgLib();
		}
		return bean;
	}
}
